/**
 * @File   : layout.tsx
 * @Author : xue.xiaoBing
 * @Date   : 2024/3/22 14:49
 * @Desc   : 首页视频播放
 * */

import {useState} from "react";
import {Video} from "@nutui/nutui-react-taro";


const options = {
  controls: false,
  autoplay: true,
  disabled: true,
  muted: true,
  playsinline: true,
  loop: true,
}

const VideoShow = () => {

  const [source, setSource] = useState({
    src: 'https://storage.360buyimg.com/nutui/video/video_NutUI.mp4',
    type: 'video/mp4',
  })

  const play = (elm: any) => console.log('play', elm)
  const pause = (elm: any) => console.log('pause', elm)
  const playend = (elm: any) => console.log('playend', elm)

  return (
    <Video
      source={source}
      options={options}
      onPlay={play}
      onPause={pause}
      onPlayEnd={playend}
      style={{height: '163px'}}
    />
  )
}

export default VideoShow;
